﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using LastoRevival.Website.Models;
using System.Data;

namespace LastoRevival.Website.Data.Sql.Converters
{
	public class EditSiteUserSettingsModelCreator
	{

		public EditSiteUserSettingsModel Create(DataRow row)
		{
			var instance = new EditSiteUserSettingsModel
			{
				CollapseThreshold = (int)row["collapsethreshold"],
				ReturnToListAfterPosting = (bool)row["returntolistafterposting"],
				ShowSignatures = (bool)row["showsignatures"],
				SmileysByDefault = (bool)row["smileysbydefault"],
				Theme = string.Format("{0}", row["theme"]),
				TimeOffset = (double)row["timeoffset"],
				UserID = (int)row["userid"],
			};

			return instance;
		}

	}
}